package com.zgcj.mall.test;

import java.lang.management.ManagementFactory;
import com.sun.management.OperatingSystemMXBean;


public class test {
	
    public static void main(String[] args){
    	System.out.println(getEMS());
    }
    
    
    public static String getEMS() {  
        StringBuffer sb=new StringBuffer();  
        OperatingSystemMXBean osmxb = ManagementFactory.getPlatformMXBean(OperatingSystemMXBean.class);
           sb.append("系统物理内存总计：" + osmxb.getTotalPhysicalMemorySize()  
                / 1024 / 1024 + "MB<br>");  
           sb.append("系统物理可用内存总计：" + osmxb.getFreePhysicalMemorySize()  
                / 1024 / 1024 + "MB");  
        return sb.toString();  
    }  
  
}


